#pragma once

#include "VisioCommon.h"
#include <vector>

typedef std::pair<UINT, UINT> View;
typedef std::vector<View> ViewVector;
typedef std::vector<UINT> CameraIndexVector;

class CTrackData;

//a refinement of a track i.e a subset of the view vector of the parent track
struct SSharedView
{
	CTrackData* pTrack; // the parent track
	ViewVector views;
};

// track is a set of pairs (a, b) where a is the image and b is the keypoint index in that image
// i.e all the keypoints viewing the same point
class CTrackData
{
public:
	CTrackData(ViewVector _views);
	UINT GetNumViews() const;
	View GetView(UINT index);
	void MarkPoint(int index);
	int GetMark() const;
	//return ture if we already found the point coresponding to this track
	
	SSharedView IsVisable(CameraIndexVector ImIndices);
	void RemoveMark();

	//this two next function requires some explantions

	//is marked checks whether this track points to a valid point in the point cloud
	bool IsMarked() const;

	//is dirty checks whether this track was already added it and was removed
	bool IsDirty() const;
private:
	ViewVector m_Views;

	//an index to where we can find the point in out point pool 
	int m_PointIndex;
};